package com.publicprintingwithjason.gui;



import com.golden.gamedev.object.Sprite;
import java.awt.Point;
import java.util.ArrayList;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Classe que implementa os agentes (usuarios e responsavel pelos suprimentos)
 * @author azul
 */
public class User extends Sprite{
    private ArrayList<Point> destination;

    public User(int x, int y) {
        super(x, y);
        destination = new ArrayList<Point>();
    }

    public User(Point p){
        this(p.x, p.y);
    }

    public Point getPosition(){
        return new Point((int)Math.round(getX()), (int)Math.round(getY()));
    }

    public ArrayList<Point> getDestinations() {
        return destination;
    }

    public void addDestination(ArrayList<Point> destination) {
        this.destination.addAll(destination);
    }

    public void addDestination(Point destination) {
        this.destination.add(destination);
    }

    public Point getNextDestination(){
        if(!destination.isEmpty()){
            return destination.get(0);
        }
        return null;
    }
    
    public Point getLastDestination(){
        if(!destination.isEmpty()){
            return destination.get(destination.size()-1);
        }
        return null;
    }

    public boolean hasDestination(){
        if(destination.isEmpty())
            return false;
        return true;
    }

    public Point removeDestination() {
        return destination.remove(0);
    }
}
